#!/bin/bash
#
df -hT | grep "^/dev" | while read line; do
    usage=$(echo "$line" | awk '{print $6}' | awk -F% '{print $1}')
    if [ "$usage" -gt 20 ]; then
        disk_name=$(echo "$line" | awk '{print $1}')
        total_size=$(echo "$line" | awk '{print $3}')
        free_size=$(echo "$line" | awk '{print $5}')
        echo "硬盘名称：$disk_name  总容量：$total_size  可用容量：$free_size"
    fi
done
